/*
 * 系统全局事件注册 creator by wangjun on 2012.8.23 
 */

/*
 * 首页加入收藏
 */
function addFavorites(location, title) {
	try { window.external.addFavorite(location,title); }
	catch (e) {
		try { window.sidebar.addPanel(title, location, '');  }
		catch (e) { alert('不支持的浏览器，加入收藏失败，请使用Ctrl+D手动收藏!')};
	}
}

/*
 * 首页设为首页
 */
function setHomePage(location) {
	try { 
		document.body.style.behavior = 'url(#default#homepage)';
		document.body.setHomePage(location);
	} catch (e) {
		try { 
			netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
		} catch (e) {
			alert("该操作被浏览器拒绝，如果想启用该功能，\n" +
					"请在地址栏内输入about:config,然后将项\"\n" +
					"signed.applets.codebase_principal_support\"\n" +
					"值该为true");                
		}
	}
}




function clickPlayBox(data) {
    var tag = encodeURI(encodeURI(data));
    location.href = "/page/filmListByCondition.html?page=1&tag=" + tag;


	/*
	var playBoxForm = document.getElementById('playBoxForm');
	var playBoxHidden = document.getElementById('playBoxHidden');
	var actionUrl;
	if (type == 'showtime') {
		actionUrl = 'searchfilmByShowTime.html';
	} else if (type == 'region') {
		actionUrl = 'searchfilmByRegion.html';
	} else if (type == 'tag') {
		actionUrl = 'searchfilmByTags.html';
	}
	
	playBoxHidden.value = data;
	playBoxForm.method = 'post';
	playBoxForm.action = actionUrl;
	playBoxForm.submit();
	*/
}

function change(ms) {
	    var hours = Math.floor((ms%86400)/3600);  
		var minutes = Math.floor(((ms%86400)%3600)/60);   
		var seconds = Math.floor(((ms%86400)%3600)%60);
	   	
	   	var strHour = hours < 10 ? "0" + hours : "" + hours;
	   	var strMinute = minutes < 10 ? "0" + minutes : "" + minutes;
	   	var strSecond = seconds < 10 ? "0" + seconds : "" + seconds;
	   	return strHour + ":" + strMinute + ":" + strSecond;
	   	}
	
var intervalProcess;   	
function playPageOnload() {
						var qvodplayer = document.getElementById('qvodplayer');
						if (qvodplayer.PlayState == 3) {
							var bigPlayerTotalTime = document.getElementById('bigPlayerTotalTime');
							bigPlayerTotalTime.innerText = change(qvodplayer.Duration);
						} else {
							setTimeout("playPageOnload()", 1000);
							intervalProcess = setInterval("playTimeing()", 1000);
						}
					} 

var offectWidth = 0;
function playTimeing() {
	var qvodplayer = document.getElementById('qvodplayer');
	var bigPlayerTotalTime1 = document.getElementById('bigPlayerTotalTime1');
	var tvPlayerSliderBlock = document.getElementById('tvPlayerSliderBlock');
	var tvPlayerSliderBarCurrent = document.getElementById('tvPlayerSliderBarCurrent');
	
	bigPlayerTotalTime1.innerText = change(qvodplayer.Currentpos);
	
	offectWidth = offectWidth + (390 / qvodplayer.Duration);
	tvPlayerSliderBlock.style.left = offectWidth;
	tvPlayerSliderBarCurrent.style.width = offectWidth;
} 

/* 页面头验证码聚焦弹出层 */
function toggleVerifyCode(obj) {
    var codeInputPoint = getAbsolutePos(obj);
	var codeDiv = document.getElementById('codeDiv');
	codeDiv.style.left = codeInputPoint.x + "px";
	codeDiv.style.top = (codeInputPoint.y + obj.offsetHeight + 1) + "px";
	show_box('codeDiv');
}

/****************** 计算对象的位置 *************************/
function getAbsolutePos(el) {
	var r = { x: el.offsetLeft, y: el.offsetTop };
	if (el.offsetParent) {
		var tmp = getAbsolutePos(el.offsetParent);
		r.x += tmp.x;
		r.y += tmp.y;
	}
	return r;
}

//各种浏览器的判断参数
var isIE6 = false;
var isIE7 = false;
var isIE = false;
var firefox = false;
var chrome = false;
var opera = false;
var safari = false;
var Sys = {};
var ua = navigator.userAgent.toLowerCase();
var s;
(s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
(s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
(s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
(s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
(s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;

//以下进行参数的赋值
if (Sys.ie) {
	isIE = true;
	if(Sys.ie == 6){
		isIE6 = true;
	}
	if(Sys.ie == 7){
		isIE7 = true;
	}
}
if (Sys.firefox) firefox = true;
if (Sys.chrome) chrome = true;
if (Sys.opera) opera = true;
if (Sys.safari) safari = true;

//各种获取对象的函数
//通过id找对象
function getId(id){
	if(document.getElementById(id))
		return document.getElementById(id);
	else
		return false;
}
//通过id中的关键字找一类对象
function getObjID(type,keyword,fid){
	var fobj = 	typeof(fid) == "undefined"?document:getId(fid);
	var newArr = new Array();
	var items = fobj.getElementsByTagName(type);
	for(var i=0;i<items.length;i++){
		if(items[i].id && items[i].id.indexOf(keyword)>=0){
			newArr.push(items[i]);
		}
	}
	return newArr;
}

//鼠标经过显示列表详情
function showDetail(actObj,fid){
	var fobj = getId(fid);
	var num = actObj.id.split("_")[1];
	var details = getObjID("li","itemDetail_",fid);
	var simples = getObjID("li","itemSimple_",fid);
	
	for(var i=0;i<details.length;i++){
		details[i].style.display = "none";
		simples[i].style.display = "block";
	}
	actObj.style.display = "none";
	getId("itemDetail_"+num).style.display = "block";
}


function showDetaila(actObj,fid){
	var fobj = getId(fid);
	var num = actObj.id.split("_")[1];
	var details = getObjID("div","itemDetail_",fid);
	var simples = getObjID("div","itemSimple_",fid);
	
	for(var i=0;i<details.length;i++){
		details[i].style.display = "none";
		simples[i].style.display = "block";
	}
	actObj.style.display = "none";
	getId("itemDetail_"+num).style.display = "block";
}



//下拉框样式
function CoLeeSelect(thisObj){
 var thisinput = thisObj.getElementsByTagName("input");
 var thisul = thisObj.getElementsByTagName("ul");
 var thisli = thisul[0].getElementsByTagName("li");
 if(thisObj.id != "CoLeeSelect"){
  thisObj.id = "CoLeeSelect";
  thisObj.focus();
  thisul[0].style.display = "";
  for(var i=0;i<thisli.length;i++){
   thisli[i].onmouseover = function(){
    for(var j=0;j<thisli.length;j++){
     thisli[j].className = "";
     }
    this.className = "on";
    }
   thisli[i].onclick = function(){
    thisinput[0].value = this.innerHTML;
    }
   }
  }else{
   ObjBlur();
  }
  thisObj.onblur = ObjBlur;
  function ObjBlur(){
   thisObj.id =  "";
   thisul[0].style.display = "none";
   thisObj.blur();
   }
 }






/*TAB标签选项卡*/
function setTab(name,cursel,n){
    var link = document.getElementById("con_" + name + "_link");
    if (name == "time") {
        link.href = "/page/filmListByCondition.html?page=1&sortColumn=createtime&type=" + cursel;
    } else if (name == "one") {
        var filmTypeId;
        if (cursel == 4) { filmTypeId = 6 }
        else if (cursel == 5) { filmTypeId = 100 }
        else if (cursel == 6) { filmTypeId = 4 }
        else if (cursel == 10) { filmTypeId = 12 }
        else { filmTypeId = cursel }
        link.href = "/page/filmListByCondition.html?page=1&sortColumn=createtime&type=1&filmTypeId=" + filmTypeId;
    }

 for(i=1;i<=n;i++){
  var menu=document.getElementById(name+i);
  var con=document.getElementById("con_"+name+"_"+i);
  menu.className=i==cursel?"hover":"";
  con.style.display=i==cursel?"block":"none";
 }



}


function setTaba(name,cursel,n){   
 for(i=1;i<=n;i++){   
  var menu=document.getElementById(name+i);   
  var con=document.getElementById("con_"+name+"_"+i);   
  //menu.className=i==cursel?"hover":"";   
  con.style.display=i==cursel?"block":"none";   
 }   
}



//ad box
var notAuto = false;
function switchAd(itemsId,contentId){
	var items = document.getElementById(itemsId).getElementsByTagName("li");
	var conObj = document.getElementById(contentId);
	var contents = conObj.getElementsByTagName("li");
	var conTop = [];
	document.getElementById(itemsId).onmouseover = function(){notAuto = true};
	document.getElementById(itemsId).onmouseout = function(){notAuto = false};
	for(var i=0;i<contents.length;i++){
		conTop.push(-contents[i].offsetTop);
	}
	for(var j=0;j<items.length;j++){
		items[j].setAttribute("index",j);
		items[j].onmouseover = function(){
			var curNum = this.getAttribute("index");
			for(var n=0;n<items.length;n++){
				if(items[n].className.indexOf("_current")>=0){
					items[n].className = items[n].className.replace("_current","_normal");	
				}
			}
			moveElement(contentId,conTop[curNum],5);
			if(this.className.indexOf("_normal")>=0){
				this.className = this.className.replace("_normal","_current");
			}
		}
	}
}

function autoSwitch(itemsId,contentId){
	if(notAuto) return false;
	var items = document.getElementById(itemsId).getElementsByTagName("li");
	var conObj = document.getElementById(contentId);
	var contents = conObj.getElementsByTagName("li");
	var conTop = [];
	var curNum =0;
	for(var i=0;i<contents.length;i++){
		conTop.push(-contents[i].offsetTop);
	}
	for(var j=0;j<items.length;j++){
		if(items[j].className.indexOf("_current")>=0){
			curNum = j;
		}
	}	
	if(curNum == (items.length -1)){
		for(var n=0;n<items.length;n++){
			if(items[n].className.indexOf("_current")>=0){
				items[n].className = items[n].className.replace("_current","_normal");	
			}
		}
		items[0].className = items[0].className.replace("_normal","_current");
		moveElement(contentId,conTop[0],10);
	}
	else{
		for(var n=0;n<items.length;n++){
			if(items[n].className.indexOf("_current")>=0){
				items[n].className = items[n].className.replace("_current","_normal");	
			}
		}
		items[curNum+1].className = items[curNum+1].className.replace("_normal","_current");
		moveElement(contentId,conTop[curNum+1],10);	
	}
}

function lrcScroll(fid){
	var scrollTime = 0;
	if(hasObj(fid)){
		var fobj = document.getElementById(fid);
	}
	if(fobj.style.display == "none"){
		fobj.style.display = "block";	
		if(fobj.getElementsByTagName("li")[0]){
			var lrclis = fobj.getElementsByTagName("li");
			var heightArr = new Array();
			for(var i=0;i<lrclis.length;i++){
				heightArr.push(lrclis[i].offsetHeight);
			}
		}
		fobj.style.display = "none";
	}
		
	var j=0;
	scrollTime = setInterval(function(){ lrclis[j].className = "cur_lrc";if(j>0){lrclis[j-1].className = "";} if(j>1 && fobj.style.display != "none"){var scrollHeight = heightArr[j]; fobj.scrollTop += scrollHeight; }  if(j<lrclis.length-1) j++; if(lrclis[lrclis.length-1].className == "cur_lrc"){ j = 0; fobj.scrollTop = 0; clearTimeout(scrollTime);}},2000);
}

function moveElement(elementId,final_top,interval) {
	var element = document.getElementById(elementId);
	
	if (element.movement) {
		clearTimeout(element.movement);
	}
	if (!element.style.marginTop) {
		element.style.marginTop = "0px";
	}
	var mt = parseInt(element.style.marginTop);
	if (mt == final_top) {
		return true;
	}
	if (mt < final_top) {
		var dist = Math.ceil((final_top - mt)/10);
		mt = mt + dist;
	}
	if (mt > final_top) {
		var dist = Math.ceil((mt - final_top)/10);
		mt = mt - dist;
	}
	element.style.marginTop = mt + "px";
	var repeat = "moveElement('"+elementId+"',"+final_top+","+interval+")";
	element.movement = setTimeout(repeat,interval);

}





//player Volumn Control
function volumnControl(obj,oEvent,aimId){
	var aimObj = document.getElementById(aimId);
	var qvodplayer = document.getElementById('qvodplayer');
	var e = oEvent || window.event; 
	var target = e.target || e.srcElement;  
	var imgArray = obj.getElementsByTagName("img"); 
	for(var i=0;i<imgArray.length;i++){ 
	   imgArray[i]._num = i; 
	} 
	if(target.tagName=="IMG"){ 
		var j;
	   for(j=0;j<imgArray.length;j++){ 
			if(j<=target._num){ 
				 var imgSrc =  imgArray[j].src;
				 var newImg = imgSrc.replace("grey","green");
				 imgArray[j].src=newImg; 
				 aimObj.className = aimObj.className.replace("_player_silence","_player_volumn");
				 if (j == 0) {
				 	qvodplayer.Volume = 10;
				 } else if (j == 6) {
				 	qvodplayer.Volume = 100;
				 } else {
				 	qvodplayer.Volume = j * 20;
				 }
				 // alert(qvodplayer.Volume);
			} 
			else { 
				 var imgSrc =  imgArray[j].src;
				 var newImg = imgSrc.replace("green","grey");
				 imgArray[j].src=newImg;
				  
			} 
	   }
	} 
} 
function silenceVolumn(actObj,aimId){
	var qvodplayer = document.getElementById('qvodplayer');
	var aimObj = document.getElementById(aimId);
	var aimImg = aimObj.getElementsByTagName("img");
	if(actObj.className.indexOf("_player_volumn")>=0){
		actObj.className = actObj.className.replace("_player_volumn","_player_silence");
		for(var j=0;j<aimImg.length;j++){ 
			 var imgSrc =  aimImg[j].src;
			 var newImg = imgSrc.replace("green","grey");
			 aimImg[j].src=newImg; 
		}
		qvodplayer.Mute  = true;
	}
	else {
		actObj.className = actObj.className.replace("_player_silence","_player_volumn");
		for(var j=0;j<3;j++){ 
			 var imgSrc =  aimImg[j].src;
			 var newImg = imgSrc.replace("grey","green");
			 aimImg[j].src=newImg; 
		}
		qvodplayer.Mute  = false;
	}
}
//control loading bar
//loadingSlider(event,this,'tvPlayerSliderBarCurrent','tvPlayerSliderBarDefault')
function loadingSlider(oEvent,actObj,curId,defaultId){
	var e = oEvent || window.event; 
	var curBar = document.getElementById(curId);
	var trueWidth = document.getElementById(defaultId).offsetWidth;
	var startX = e.clientX;
	var origX = actObj.offsetLeft;
    var deltaX = startX - origX;
	
	if (document.addEventListener) {  
        document.addEventListener("mousemove", moveHandler, true);
        document.addEventListener("mouseup", upHandler, true);
    }
    else if (document.attachEvent) {  
        actObj.setCapture( );
        actObj.attachEvent("onmousemove", moveHandler);
        actObj.attachEvent("onmouseup", upHandler);
        actObj.attachEvent("onlosecapture", upHandler);
    }
    else {  
        var oldmovehandler = document.onmousemove; // used by upHandler( )
        var olduphandler = document.onmouseup;
        document.onmousemove = moveHandler;
        document.onmouseup = upHandler;
    }
  function moveHandler(e) {
		if((e.clientX - deltaX)<0) {
			 actObj.style.left = "0px";
			 curBar.style.width = "0px";
		}
		else {
			if((e.clientX - deltaX) <= trueWidth ){
				 actObj.style.left = (e.clientX - deltaX)/100 * 95 + "px";
				 curBar.style.width = (e.clientX - deltaX) +"px";
			}
		}
        // And don't let anyone else see this event.
        if (e.stopPropagation) e.stopPropagation( );  // DOM Level 2
        else e.cancelBubble = true;                  // IE
    }

    function upHandler(e) {
        if (document.removeEventListener) {  // DOM event model
            document.removeEventListener("mouseup", upHandler, true);
            document.removeEventListener("mousemove", moveHandler, true);
        }
        else if (document.detachEvent) {  // IE 5+ Event Model
            actObj.detachEvent("onlosecapture", upHandler);
            actObj.detachEvent("onmouseup", upHandler);
            actObj.detachEvent("onmousemove", moveHandler);
            actObj.releaseCapture( );
        }
        else {  // IE 4 Event Model
            // Restore the original handlers, if any
            document.onmouseup = olduphandler;
            document.onmousemove = oldmovehandler;
        }

        if (e.stopPropagation) e.stopPropagation( );  // DOM Level 2
        else e.cancelBubble = true;                  // IE
    }
}
//control media play or pause
function playPauseMeida(actObj){
	var qvodplayer = document.getElementById('qvodplayer');
	if(actObj.className.indexOf("_player_play")>=0){
		actObj.className = actObj.className.replace("_player_play","_player_pause");
		qvodplayer.Pause();	
		clearInterval(intervalProcess);
	}
	else {
		actObj.className = actObj.className.replace("_player_pause","_player_play");
		qvodplayer.Play();
		intervalProcess = setInterval("playTimeing()", 1000);
	}
}

function playStopMeida() {
	var qvodplayer = document.getElementById('qvodplayer');
	qvodplayer.Stop();
	clearInterval(intervalProcess);
}

//control media full screen or revert
function fullrevertScreen(actObj){
	var qvodplayer = document.getElementById('qvodplayer');
	if (qvodplayer.full == false) {
		// actObj.className = actObj.className.replace("_player_revert","_player_full");	
		actObj.title = "全屏";
		qvodplayer.full = true;
	}
	
	/*if(actObj.className.indexOf("_player_full")>=0){
		actObj.className = actObj.className.replace("_player_full","_player_revert");
		actObj.title = "退出全屏";
		qvodplayer.full = true;
	}
	else {
		actObj.className = actObj.className.replace("_player_revert","_player_full");	
		actObj.title = "全屏";
		qvodplayer.full = false;
	}*/
}

//show mobile newspaper
function showPreview(title,popwidth,popheight){
	var popleft = (document.documentElement.clientWidth - popwidth)/2;
	var poptop =0;
	if(document.documentElement.clientHeight > popheight){
		poptop = (document.documentElement.clientHeight - popheight)/2;
	}
	else {
		poptop = 0;	
	}
	window.open("preview.html",title,"height="+popheight+",width="+popwidth+",left="+popleft+",top="+poptop+",scrollbars=no,status=no,toolbar=no,menubar=no,location=no");
}





//显示隐藏拷贝代码层
function show_box(c_Str)
{
   var c_Str = document.getElementById(c_Str);
{
     if(c_Str.style.display=='none'){
	 c_Str.style.display='';
}
    else{
	 c_Str.style.display='none';
}
}
}


//自助服务下拉菜单
var cssdropdown={
disappeardelay: 250, //set delay in miliseconds before menu disappears onmouseout
disablemenuclick: true, //when user clicks on a menu item with a drop down menu, disable menu item's link?
enableswipe: 1, //enable swipe effect? 1 for yes, 0 for no

//No need to edit beyond here////////////////////////
dropmenuobj: null, ie: document.all, firefox: document.getElementById&&!document.all, swipetimer: undefined, bottomclip:0,

getposOffset:function(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
},

swipeeffect:function(){
if (this.bottomclip<parseInt(this.dropmenuobj.offsetHeight)){
this.bottomclip+=10+(this.bottomclip/10) //unclip drop down menu visibility gradually
this.dropmenuobj.style.clip="rect(0 auto "+this.bottomclip+"px 0)"
}
else
return
this.swipetimer=setTimeout("cssdropdown.swipeeffect()", 10)
},

showhide:function(obj, e){
if (this.ie || this.firefox)
this.dropmenuobj.style.left=this.dropmenuobj.style.top="-500px"
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover"){
if (this.enableswipe==1){
if (typeof this.swipetimer!="undefined")
clearTimeout(this.swipetimer)
obj.clip="rect(0 auto 0 0)" //hide menu via clipping
this.bottomclip=0
this.swipeeffect()
}
obj.visibility="visible"
}
else if (e.type=="click")
obj.visibility="hidden"
},

iecompattest:function(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
},

clearbrowseredge:function(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=this.ie && !window.opera? this.iecompattest().scrollLeft+this.iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetWidth
if (windowedge-this.dropmenuobj.x < this.dropmenuobj.contentmeasure)  //move menu to the left?
edgeoffset=this.dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=this.ie && !window.opera? this.iecompattest().scrollTop : window.pageYOffset
var windowedge=this.ie && !window.opera? this.iecompattest().scrollTop+this.iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetHeight
if (windowedge-this.dropmenuobj.y < this.dropmenuobj.contentmeasure){ //move up?
edgeoffset=this.dropmenuobj.contentmeasure+obj.offsetHeight
if ((this.dropmenuobj.y-topedge)<this.dropmenuobj.contentmeasure) //up no good either?
edgeoffset=this.dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
},

dropit:function(obj, e, dropmenuID){
if (this.dropmenuobj!=null) //hide previous menu
this.dropmenuobj.style.visibility="hidden" //hide menu
this.clearhidemenu()
if (this.ie||this.firefox){
obj.onmouseout=function(){cssdropdown.delayhidemenu()}
obj.onclick=function(){return !cssdropdown.disablemenuclick} //disable main menu item link onclick?
this.dropmenuobj=document.getElementById(dropmenuID)
this.dropmenuobj.onmouseover=function(){cssdropdown.clearhidemenu()}
this.dropmenuobj.onmouseout=function(){cssdropdown.dynamichide(e)}
this.dropmenuobj.onclick=function(){cssdropdown.delayhidemenu()}
this.showhide(this.dropmenuobj.style, e)
this.dropmenuobj.x=this.getposOffset(obj, "left")
this.dropmenuobj.y=this.getposOffset(obj, "top")
this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+"px"
this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight-1+"px"
}
},

contains_firefox:function(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
},

dynamichide:function(e){
var evtobj=window.event? window.event : e
if (this.ie&&!this.dropmenuobj.contains(evtobj.toElement))
this.delayhidemenu()
else if (this.firefox&&e.currentTarget!= evtobj.relatedTarget&& !this.contains_firefox(evtobj.currentTarget, evtobj.relatedTarget))
this.delayhidemenu()
},

delayhidemenu:function(){
this.delayhide=setTimeout("cssdropdown.dropmenuobj.style.visibility='hidden'",this.disappeardelay) //hide menu
},

clearhidemenu:function(){
if (this.delayhide!="undefined")
clearTimeout(this.delayhide)
},

startchrome:function(){
for (var ids=0; ids<arguments.length; ids++){
var menuitems=document.getElementById(arguments[ids]).getElementsByTagName("a")
for (var i=0; i<menuitems.length; i++){
if (menuitems[i].getAttribute("rel")){
var relvalue=menuitems[i].getAttribute("rel")
menuitems[i].onmouseover=function(e){
var event=typeof e!="undefined"? e : window.event
cssdropdown.dropit(this,event,this.getAttribute("rel"))
}
}
}
}
}

}



//弹出窗口
function openwindow(url, name, iWidth, iHeight) {
        var url; //转向网页的地址;
        var name; //网页名称，可为空;
        var iWidth; //弹出窗口的宽度;
        var iHeight; //弹出窗口的高度;
        var iTop = (window.screen.availHeight - 30 - iHeight) / 2; 
        var iLeft = (window.screen.availWidth - 10 - iWidth) / 2; 
        window.open(url, name, 'height=' + iHeight + ',,innerHeight=' + iHeight + ',width=' + iWidth + ',innerWidth=' + iWidth + ',top=' + iTop + ',left=' + iLeft + ',toolbar=no,menubar=no,location=no,status=no');
    }


// --列头全选框被单击---
function ChkAllClick(sonName, cbAllId){
    var arrSon = document.getElementsByName(sonName);
 var cbAll = document.getElementById(cbAllId);
 var tempState=cbAll.checked;
 for(i=0;i<arrSon.length;i++) {
  if(arrSon[i].checked!=tempState)
           arrSon[i].click();
 }
}

// --子项复选框被单击---
function ChkSonClick(sonName, cbAllId) {
 var arrSon = document.getElementsByName(sonName);
 var cbAll = document.getElementById(cbAllId);
 for(var i=0; i<arrSon.length; i++) {
     if(!arrSon[i].checked) {
     cbAll.checked = false;
     return;
     }
 }
 cbAll.checked = true;
}


//列表页编辑管理
function changeclass(aaID, bbID , ccID){
	var aObj = document.getElementById(aaID);
	var bObj = document.getElementById(bbID);
	var cObj = document.getElementById(ccID);
	
	if(cObj.style.display != "none"){
		cObj.style.display = "none";
		aObj.className = "chose_topon";
		bObj.className = "my_v_ulon";
	}
	else {
		cObj.style.display = "block";
		aObj.className = "chose_top";
		bObj.className = "my_v_ul";
	}
}